<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>梯形面积</title>
</head>

<body>
	<script language="Javascript">
	function rec(form){
		
	form.newvalue.value=(form.th2.value*form.th3.value+form.th1.value*form.th3.value)/2
	
	}
	
	
	
	</script>
	
	

	<form action="">
	<h1>梯形的面积</h1>
	下底
	<input type="text" name="th1"><br>
	上底
	<input type="text" name="th2"><br>	
	高
	<input type="text" name="th3"><br>
		
	<input type="button" name="button" onClick="rec(this.form)" value="面积" >
		
	<input type="text" name="newvalue">	
		
	
	</form>
	
	
</body>
</html>
